/*
 * @Descripttion: 多画面播放器配置文件
 * @version: V1.0.0.0
 * @Author: zhaozhenzhuo
 * @Date: 2025-01-22 14:21:17
 * @LastEditors: zhaozhenzhuo
 * @LastEditTime: 2025-02-12 13:34:39
 */

import {
  ProgressDotOptions,
  SupportedType,
  DisplayMode,
  ShowType,
  VerticalAlign,
  HorizontalAlign,
} from './types';

// 播放器布局配置
export const LAYOUT_CONFIG = {
  DEFAULT_GAP: 2,
  DEFAULT_VERTICAL_ALIGN: 'center' as const,
  DEFAULT_HORIZONTAL_ALIGN: 'center' as const,
  DEFAULT_DISPLAY_MODE: 'pave' as const,
  DEFAULT_SHOW_TYPE: 'width' as const,
} as const;

// 播放器默认配置
export const PLAYER_CONFIG = {
  DEFAULT_TYPE: 'mp4',
  DEFAULT_AUTOPLAY: true,
  DEFAULT_IS_LIVE: false,
  DEFAULT_VOLUME: 0.7,
  DEFAULT_MINI_VOLUME: 0.7,
  DEFAULT_ERROR_TIPS: '预览失败，请检查设备是否正常',
  DEFAULT_END_TIPS: '播放已结束',
  DEFAULT_PLACEHOLDER: '暂无画面',
  DEFAULT_ENABLE_VOLUME_MEMORY: false,
  DEFAULT_NO_SUPPORT: '您的浏览器暂不支持播放此视频',
} as const;

// 播放器样式类配置
export const CLASS_CONFIG = {
  MULTI_LAYER_WRAP: 'multi-layer-wrap',
  MULTI_LAYER: 'multi-layer',
  VIDEO_WRAP: 'video-wrap',
  LARGE_CLASS: 'multi-layer-large',
  SMALL_CLASS_1: 'multi-layer-small-1',
  SMALL_CLASS_2: 'multi-layer-small-2',
  SMALL_CLASS_3: 'multi-layer-small-3',
  SMALL_CLASS_4: 'multi-layer-small-4',
  SMALL_CLASS_5: 'multi-layer-small-5',
  VIDEO_ERROR: 'video-error',
  VIDEO_IS_FINISH: 'video-is-finish',
  MULTI_PLAYER_STYLE: 'multiPlayerStyle',
  MULTI_PLAYER_ERROR_STYLE: 'multiPlayerErrorStyle',
} as const;

// 水印配置
export const WATERMARK_CONFIG = {
  FONT_SIZE: '14px',
  FONT_FAMILY: 'Alibaba PuhuiTi',
  FONT_COLOR: '#666666',
  ROTATE_DEGREE: -30,
  SPACING: 300,
} as const;

// 默认配置接口
export interface DefaultConfig {
  type: SupportedType;
  isLive: boolean;
  autoplay: boolean;
  volume: number;
  miniVolume: number;
  verticalAlign: VerticalAlign;
  horizontalAlign: HorizontalAlign;
  gap: number;
  displayMode: DisplayMode;
  showType: ShowType;
  enableVolumeMemory: boolean;
  errorTips: string;
  endTips: string;
  placeholder: string;
  noSupport: string;
  progressDot: ProgressDotOptions[];
  watermarkText: string;
}

// 默认配置
export const DEFAULT_CONFIG: DefaultConfig = {
  type: PLAYER_CONFIG.DEFAULT_TYPE,
  isLive: PLAYER_CONFIG.DEFAULT_IS_LIVE,
  autoplay: PLAYER_CONFIG.DEFAULT_AUTOPLAY,
  volume: PLAYER_CONFIG.DEFAULT_VOLUME,
  miniVolume: PLAYER_CONFIG.DEFAULT_MINI_VOLUME,
  verticalAlign: LAYOUT_CONFIG.DEFAULT_VERTICAL_ALIGN,
  horizontalAlign: LAYOUT_CONFIG.DEFAULT_HORIZONTAL_ALIGN,
  gap: LAYOUT_CONFIG.DEFAULT_GAP,
  displayMode: LAYOUT_CONFIG.DEFAULT_DISPLAY_MODE,
  showType: LAYOUT_CONFIG.DEFAULT_SHOW_TYPE,
  enableVolumeMemory: PLAYER_CONFIG.DEFAULT_ENABLE_VOLUME_MEMORY,
  errorTips: PLAYER_CONFIG.DEFAULT_ERROR_TIPS,
  endTips: PLAYER_CONFIG.DEFAULT_END_TIPS,
  placeholder: PLAYER_CONFIG.DEFAULT_PLACEHOLDER,
  noSupport: PLAYER_CONFIG.DEFAULT_NO_SUPPORT,
  progressDot: [],
  watermarkText: '',
} as const;
